package usuario.usuarioDAO;

import modelUtil.Configuracion;

public final class UsuarioDAOFactory {

	private UsuarioDAOFactory() {
	}

	public static IUsuarioDAO GetDAO() {

		try {
			Configuracion.instancia().leerDoc();
			String daoClassName = Configuracion.instancia().getUsuarioDAOclass();

			if (daoClassName.equals("XMLUsuarioDAO")) {
				/*
				 * Assembly assembly = Assembly.GetExecutingAssembly();
				 * 
				 * Object theObject = AppDomain.CurrentDomain.
				 * CreateInstanceAndUnwrap(assembly.FullName, daoClassName);
				 */Object theObject = new XMLUsuarioDAO();
				return (IUsuarioDAO) theObject;
			}

			return null;
		} catch (Exception e) {

			return null;
		}

	}

}
